cmake_minimum_required(VERSION 2.8.3)
project(imu_collect)

set(CMAKE_CXX_STANDARD 14)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  message_generation
  roscpp
  rospy
  serial
  std_msgs
  tf
  sensor_msgs
)

catkin_package(
  CATKIN_DEPENDS
  message_runtime
)

# 头文件路径
include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)

# 生成可执行文件
add_executable( imu_collector src/imu_collector.cpp src/serialport.cpp)
#该项让编译器知道要注意编译顺序
add_dependencies(imu_collector ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 
# 链接库
target_link_libraries(imu_collector ${catkin_LIBRARIES})
